package com.xzj.admin.flow.mapper;

import com.xzj.admin.flow.domain.entity.FlowNode;
import com.xzj.admin.flow.domain.entity.FlowNodeEdge;
import com.xzj.admin.flow.domain.entity.FlowNodePort;
import com.xzj.admin.flow.domain.vo.edge.FlowEdgeVo;
import com.xzj.admin.flow.domain.vo.node.FlowNodeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: xzj-admin
 * @ClassName: FlowNodeMapper
 * @description: 流程节点;(flow_node)表数据库访问层
 * @author: XiaZunJun
 * @create: 2024-9-27
 */
@Mapper
public interface FlowNodeMapper {

    List<FlowNodeVo> queryByFlowId(String flowId);

    /**
     * 新增数据
     *
     * @param flowNode 实例对象
     * @return 影响行数
     */
    int insert(FlowNode flowNode);

    int batchInsert(@Param("list") List<FlowNode> flowNodes);

    /**
     * 更新数据
     *
     * @param flowNode 实例对象
     * @return 影响行数
     */
    int update(FlowNode flowNode);

    /**
     * 通过主键删除数据
     *
     * @param flowId 流程Id
     * @return 影响行数
     */
    int deleteByFlowId(String flowId);

    int portBatchInsert(@Param("list") List<FlowNodePort> portList);

    int portDeleteByFlowId(String flowId);

    int edgeBatchInsert(@Param("list") List<FlowNodeEdge> edgeList);

    int deleteEdgeByFlowId(String flowId);

    List<FlowEdgeVo> queryEdgeByFlowId(String flowId);
}